Class Turn

java.lang.Object
ddejonge.bandana.tools.Turn
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Turn>

public class Turn
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<Turn>
Immutable class that represents a year/phase pair.
Author:
Dave de Jonge
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    Turn​(int year, es.csic.iiia.fabregues.dip.board.Phase phase)  
    Turn​(es.csic.iiia.fabregues.dip.board.Game game)  
  • Method Summary

    Modifier and Type Method Description
    int compareTo​(Turn other)
    Returns a positive value if this turn comes after the given other turn.
    boolean equals​(java.lang.Object obj)  
    Turn getNext()
    Returns a new Turn object representing the next turn.
    static es.csic.iiia.fabregues.dip.board.Phase getNextPhase​(es.csic.iiia.fabregues.dip.board.Phase phase)  
    es.csic.iiia.fabregues.dip.board.Phase getPhase()  
    Turn getPrevious()
    Returns a new Turn object representing the previous turn.
    static es.csic.iiia.fabregues.dip.board.Phase getPreviousPhase​(es.csic.iiia.fabregues.dip.board.Phase phase)  
    int getYear()  
    int hashCode()  
    boolean isBuildPhase()  
    static boolean isBuildPhase​(es.csic.iiia.fabregues.dip.board.Phase phase)  
    boolean isMovePhase()  
    static boolean isMovePhase​(es.csic.iiia.fabregues.dip.board.Phase phase)  
    boolean isRetreatPhase()  
    static boolean isRetreatPhase​(es.csic.iiia.fabregues.dip.board.Phase phase)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Turn

      public Turn​(int year, es.csic.iiia.fabregues.dip.board.Phase phase)
    • Turn

      public Turn​(es.csic.iiia.fabregues.dip.board.Game game)
  • Method Details

    • isMovePhase

      public static boolean isMovePhase​(es.csic.iiia.fabregues.dip.board.Phase phase)
    • isRetreatPhase

      public static boolean isRetreatPhase​(es.csic.iiia.fabregues.dip.board.Phase phase)
    • isBuildPhase

      public static boolean isBuildPhase​(es.csic.iiia.fabregues.dip.board.Phase phase)
    • getNext

      public Turn getNext()
      Returns a new Turn object representing the next turn.
      Returns:
    • getPrevious

      public Turn getPrevious()
      Returns a new Turn object representing the previous turn.
      Returns:
    • getYear

      public int getYear()
    • getPhase

      public es.csic.iiia.fabregues.dip.board.Phase getPhase()
    • isMovePhase

      public boolean isMovePhase()
    • isRetreatPhase

      public boolean isRetreatPhase()
    • isBuildPhase

      public boolean isBuildPhase()
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • compareTo

      public int compareTo​(Turn other)
      Returns a positive value if this turn comes after the given other turn.
      Specified by:
      compareTo in interface java.lang.Comparable<Turn>
      Parameters:
      other -
      Returns:
    • getNextPhase

      public static es.csic.iiia.fabregues.dip.board.Phase getNextPhase​(es.csic.iiia.fabregues.dip.board.Phase phase)
    • getPreviousPhase

      public static es.csic.iiia.fabregues.dip.board.Phase getPreviousPhase​(es.csic.iiia.fabregues.dip.board.Phase phase)